<template>
    <el-dialog title="修改客户状态" :visible="dialogAVisible" width="35%" :before-close="beforeClose">
        <el-form ref="absorbForm" label-width="120px">
            <el-form-item label="吸纳备注">
                <el-input type="textarea" v-model="reason" placeholder="吸纳备注"/>
            </el-form-item>
        </el-form>
        <div class="dialog-footer" slot="footer">
            <el-button type="primary" @click="absorbCust()">保存</el-button>
            <el-button @click="beforeClose()">关闭</el-button>
        </div>
    </el-dialog>
</template>

<script>
    import {transferCustomerApi} from '@/request/api'
    export default {
        name: "AbsorbCustomer",
        props: ['rowData', 'dialogAVisible'],
        data() {
            return {
                reason: ''
            }
        },
        methods: {
            beforeClose() {
                this.$emit('closeADialog')
            },
            absorbCust() {
                transferCustomerApi({
                    customer:{
                        id: this.rowData.id
                    },
                    reason: this.reason
                }).then(res => {
                    if (res.success === true) {
                        this.$emit('closeADialog', true)
                    }
                })
            }
        }
    }
</script>

<style scoped>

</style>